package com.yan.design.two.behavior.s11;

/**
 * 11. 责任链模式
 *        测试
 * @author shengren.yan
 * @create 2022-08-15
 */
public class testRun {
    public static void main(String[] args) {
        PurchasrRequest p = new PurchasrRequest(1, 510, 1);

        AdempApprover a = new AdempApprover("a权限");
        BdempApprover b = new BdempApprover("b权限");
        CdempApprover c = new CdempApprover("c权限");
        DdempApprover d = new DdempApprover("d权限");

        // 需要各个审批级别，处理构成环形
        a.setApprover(b);
        b.setApprover(c);
        c.setApprover(d);
        d.setApprover(a);

        // 处理
        a.process(p);
    }
}
